gcapp.set "messageVisible","false"
Words "#sm",1,2,@gcapp.scriptMessage
#boxNum=#sm[1]-1     ! current _BOX index (0 based)
#poiNum=#sm[2]-1     ! insert after current one
gcapp.get doc,frontDocument
doc.get recRef,"keyRecord"
! find _BOX elements in this record, we want #boxNum (0 based)
recRef.findStructures maps,"_BOX"
maps.#boxNum.get boxRef
! find _POI in box element and add after it
boxRef.findStructures pois,"_POI"
if #poiNum>=0
  doc.beginUndo
  pois.#poiNum.delete
  doc.endUndo local("Remove Point of Interest")
endif
